<div id="searchBox">
    <div class="pageTitle"><img src="<?= IMG_DOMAIN ?>titles/head_7_02.gif"></div>
</div>
<div id="cont">
    <div class="ct">
        <!-- start -->
        <form name="comment-form" action="<?= DOMAIN ?>coolpowder/comment#down" method="POST">
            <div class="comment-box">
                <br>
                <input type="text" id="nickname" name="nickname" value="<?= $temp['nickname'] ? $temp['nickname'] : '您的昵称..."' ?>" onblur="if(this.value==''){this.value='您的昵称...'}" onfocus="if(this.value=='您的昵称...'){this.value=''}" />
                <div class="comment-textarea">
                    <textarea id="comment-text" class="commentText" name="comment" value="<?= $temp['comment'] ? $temp['comment'] : '编写您的美丽心情，字数不超过200字...' ?>"  onblur="if(this.value==''){this.value='编写您的美丽心情，字数不超过200字...'}" onfocus="if(this.value=='编写您的美丽心情，字数不超过200字...'){this.value=''}"><?= $temp['comment'] ? $temp['comment'] : '编写您的美丽心情，字数不超过200字...' ?></textarea>
                </div>
                <p>
                    <input id="commentBtn" type="button" onclick="form_submit();" value="提交留言" />
                </p>
            </div>
        </form>
        <!-- end -->
    </div>
</div>
<script type="text/javascript">
    var form_submit = function()
    {
        var nickname = $('[name="nickname"]').val();
        var comment  = $('[name="comment"]').val();
        if( ! nickname || nickname.length == 0 || nickname === '您的昵称...')
        {
            alert('昵称不能为空！');
            return;
        }

        if(! comment || comment.length == 0 || comment === '编写您的美丽心情，字数不超过200字...')
        {
            alert('评论不能为空！');
            return;
        }
        
        $('form[name="comment-form"]').submit();
    };
</script>